import * as bridgeService from '../../services/design/bridgeServices';
import { notification } from 'antd';
export default {

    namespace: 'action',
    state: {
        actions: [],
        actionData: {
            left: 0,
            top: 0,
            visible: false
        }
    },
    reducers: {
        setActions(state, { payload: actions }) {
            return { ...state, actions: actions ? actions : [] };
        },
        setActionData(state, { payload: actionData }) {
            return {
                ...state, actionData: actionData ? {...state.actionData,...actionData} : {
                    left: 0,
                    top: 0,
                    visible: false
                }
            };
        },
    },
    effects: {
        *updateActions({ payload: actions }, { call, put }) {
            yield put({
                type: 'setActions',
                payload: actions
            });
        },
        *updateActionData({ payload: actionData }, { call, put }) {
            yield put({
                type: 'setActionData',
                payload: actionData
            });
        }
    }
}